import type { AxiosPromise } from "axios";

import type {
  EntityApi,
  EntityReq,
  EntityModel,
  EntityList,
  EntityKey,
} from "jmash-core";

// 接口
export interface CommentApi extends EntityApi {
  // 查询流程实例历史办理记录
  findList(req: FlowHiCommentReq): AxiosPromise<FlowHiCommentList>;
}

/**
 * 分配/移交任务给某人.
 */
export interface FlowHiCommentReq extends EntityReq {
  /** 查询请求 */
  procInstId?: string;
}

export interface HiCommentKey {
  commentId: string;
}

/**
 * 历史办理记录列表.
 */
export interface FlowHiCommentList extends EntityList {
  /**
   * 办理记录列表.
   */
  results: Array<FlowHiCommentModel>;
}

/**
 * 流程实例历史办理记录.
 */
export interface FlowHiCommentModel extends EntityModel {
  /**
   * ID.
   */
  id?: string;
  /**
   * 用户ID.
   */
  userId?: string;
  /**
   * 创建时间.
   */
  time?: string;
  /**
   * 任务ID.
   */
  taskId?: string;
  /**
   * 流程实例ID.
   */
  processInstanceId?: string;
  /**
   * 类型.
   */
  type?: string;
  /**
   * Action.
   */
  action?: string;
  /**
   * 消息.
   */
  message?: string;
  /**
   * 全部信息.
   */
  fullMessage?: string;
}
